package cn.neusoft.mapper;

import cn.neusoft.pojo.Employee;
import cn.neusoft.query.EmployeeQuery;
import org.apache.ibatis.annotations.Param;

import java.util.List;

public interface EmployeeMapper extends BaseMapper<Employee> {
	int add1(Employee t);
    int add(Employee t);
    int update(Employee t);
    int update1(Employee t);
    int remove(Integer id);
   Employee getById(Integer id);
	Employee getById1(Integer id);
    List<Employee> getAll();

	/* 通过job和deptno两个字段来进行条件查询
	 *  1、EmployeeQuery
	 *        String job;
	 *        Integer deptno;
	 *  2、Map<String,Object> conditions = new HashMap<>();
	 *      conditions.put("job","XX");
	 *      conditions.put("deptno",20);
	 *  3、方法直接传递两个参数
	 *     这种情况直接传递两个参数是会报错的，需要给参数前面加注解
	 *     where job=#{job}   @Param("job")
	 *     and deptno=#{deptno}  @Param("deptno")
	 * */
	List<Employee> getByConditions(@Param("job") String job,@Param("deptno") Integer deptno);
	int getCount(EmployeeQuery employeeQuery);
	List<Employee> getByPage(EmployeeQuery employeeQuery);
	List<Employee> getBySal(EmployeeQuery employeeQuery);

	//其他业务
	List<Employee> listEmp(Employee employee);
	int delMany (List<Integer> ids );
	int addMany (List<Employee> employees);
}
